﻿<%@ include file="../include/top.jsp" %>
<%@ include file="../include/errorArea.jsp" %>


<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" style="margin-top:10px;">
            <tr>
              <td colspan="2" align="left" valign="middle" class="text_gray2">
              
              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#96bee2">
                  <tr>
                    <td height="21" background="${baseURL}/images/table_bg.jpg">&nbsp;&nbsp;<span class="text_blue_b">
                    <c:if test="${empty formdata.id || formdata.id==0}"><img src="${baseURL}/images/bit_add.png" width="16" height="14" border="0" align="absmiddle" />
添加用户</c:if> 
	  <c:if test="${not empty formdata.id && formdata.id>0}">
<img src="${baseURL}/images/bit_edit.png" width="16" height="14" border="0" align="absmiddle" /> 编辑用户</c:if></span></td>
                  </tr>
                  <tr>
                    <td height="13" align="center" valign="top" bgcolor="#FFFFFF">
					<form name="myForm" method="POST" action="${baseURL}/supplier/addUser" onsubmit="joinAclStr()">
					<input type="hidden" name="supplierId" value="${formdata.supplierId}" />
					<input type="hidden" name="id" value="${formdata.id}" />
					<input type="hidden" name="aclStr" id="aclStr"/>
<table width="100%" border="0" align="center" id="listTable" bgcolor="#FFFFFF" cellpadding="1" cellspacing="0">
	<tr style="display:none">
	  <td colspan="2" height="0" >
	  </td>
    </tr>
    <tr>
		<td align="right">供货商ID：</td>
		<td align="left">${formdata.supplierId}</td>
	</tr>
    <tr>
		<td align="right"><span class="mustInput">*</span>用户名：</td>
		<td align="left"><input name="username" type="text" id="username"
			value="${formdata.username}" size="25" maxlength="50" class="myInput"/></td>
	</tr>
	<tr>
		<td align="right"><span class="mustInput">*</span>密码 ：</td>
		<td align="left"><input name="password" type="password" id="password"
			value="${formdata.password}" size="70" maxlength="50" class="myInput"/></td>
    </tr>
    <tr>
		<td align="right">备注：</td>
		<td align="left"><input name="remark" type="text" id="remark"
			value="${formdata.remark}" size="70" maxlength="30" class="myInput"/></td>
	</tr>
	<tr>
		<td align="right">权限：</td>
		<td align="left">
		<c:forEach var="name" items="${aclNameArray}" varStatus="status">
			<label><input type="checkbox" name="acl" <c:if test="${aclArray[status.index]=='1'}">checked</c:if>/>${name}</label>
		</c:forEach>
		</td>
	</tr>
	<tr>
	  <td colspan="2" align="center">
	  	<input name="submit" type="submit" value="提交" class="myButton" />
	    &nbsp;&nbsp;
        <input name="button" type="button"
			onclick="history.go(-1)" value="返回" class="myButton"/></td>
    </tr>
	<tr>
	  <td colspan="4" align="center">&nbsp;</td>
    </tr>
</table>
</form></td>
                  </tr>
              </table></td>
            </tr>
</table>
<script>
//拼接权限字符串
function joinAclStr(checkAllFlag) {
	var str="";
	var checkArray = document.getElementsByName("acl");
	for (var i = 0; i < checkArray.length; i++) {
		str += checkArray[i].checked?"1":"0";
	}
	$("#aclStr").val(str);
}
</script>
<%@ include file="../include/bottom.jsp" %>